Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix 🐛 issue where the theme should revert to the system default when ignoreSystemMode is disabled. #7

Conversation

YosefAshenafi
Copy link

Status

Ready

Description

  • Fixed theme issue where it now reverts to the system default when ignoreSystemMode is turned off.

@YosefAshenafi YosefAshenafi self-assigned this Sep 17, 2024
Comment on lines 126 to 131
if (ignoreSystemMode) {
Colors.setScheme(scheme as SchemeType);
} else {
const systemScheme = Appearance.getColorScheme() as 'light' | 'dark' | null;
Colors.setScheme(systemScheme || 'default');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since lines 126-131 are repeated of lines 89-95, can you write a common function to handle both, please?

Comment on lines 89 to 95
if (next.ignoreSystemMode) {
Colors.setScheme(scheme as SchemeType);
} else {
Colors.setScheme('default');
// Revert to system default if ignoreSystemMode is false
const systemScheme = Appearance.getColorScheme() as 'light' | 'dark' | null;
Colors.setScheme(systemScheme || 'default');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lines 89-95 are repeated down below on lines 126-131. You should make a function that takes ignoreSystemMode as a parameter and handle both with 1 function, instead of duplicating the logic in multiple places.

@@ -145,7 +152,8 @@ export function createTheme({
if (next.ignoreSystemMode) {
Colors.setScheme(prev.scheme || defaultScheme);
} else {
Colors.setScheme('default');
const systemScheme = Appearance.getColorScheme() as 'light' | 'dark' | null;
Colors.setScheme(systemScheme || 'default');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This logic seems to be repeated again; please write a function to handle all 3 places.

@YosefAshenafi
Copy link
Author

created already in hacktoolkit

@YosefAshenafi YosefAshenafi deleted the feature/fix-ignore-system-mode-background branch September 23, 2024 10:25
jontsai pushed a commit that referenced this pull request Sep 23, 2024
## Status
Ready

## Description
- Adjust the font family selector modal to have a defined size and
enable scrolling to accommodate multiple font options.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants